package org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.policies;

import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.commands.ComponentReferenceCreateCommand;
import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.edit.commands.ComponentServiceCreateCommand;
import org.admanager.soageneralpattern.plugin.soageneralpattern.diagram.providers.GeneralSOAPatternECOREMetamodelElementTypes;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;

/**
 * @generated
 */
public class ComponentComponentCompartmentItemSemanticEditPolicy extends
		GeneralSOAPatternECOREMetamodelBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public ComponentComponentCompartmentItemSemanticEditPolicy() {
		super(GeneralSOAPatternECOREMetamodelElementTypes.Component_2001);
	}

	/**
	 * @generated
	 */
	protected Command getCreateCommand(CreateElementRequest req) {
		if (GeneralSOAPatternECOREMetamodelElementTypes.ComponentService_3001 == req
				.getElementType()) {
			return getGEFWrapper(new ComponentServiceCreateCommand(req));
		}
		if (GeneralSOAPatternECOREMetamodelElementTypes.ComponentReference_3002 == req
				.getElementType()) {
			return getGEFWrapper(new ComponentReferenceCreateCommand(req));
		}
		return super.getCreateCommand(req);
	}

}
